<?php
if($_GET['edit']){
    $id = $_GET['edit'];
    $list = $db->query("SELECT id,catname,pic FROM ".BRANDCAT." where id=$id");
    $list = $db->fetchRow();
    $tpl->assign('info',$list);
    $tpl->assign('id',$id);
    $tpl->assign('edit','1');

}
if($_POST['id']){
    $id = $_POST['id'];
    $pic = $_POST['guojiapic'];
    $sql="update ".BRANDCAT." set pic='$pic' where id =$id";
    $db->query($sql);
}
$list = $db->query("SELECT id,catname,pic FROM ".BRANDCAT." ORDER BY displayorder DESC ");
$list = $db->getRows();
$tpl->assign('list',$list);
$tpl->display("country.htm");
?>